package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.page.PageUtil;
import com.ruoyi.common.core.page.ResultEntity;
import com.ruoyi.system.domain.TProdSuggest;
import com.ruoyi.system.domain.dto.ITProdInvDTO;
import com.ruoyi.system.domain.dto.TProdRecordDTO;
import com.ruoyi.system.domain.dto.TProdSuggestDTO;
import com.ruoyi.system.domain.vo.TProdRecordSuggestVO;
import com.ruoyi.system.service.ITProdSuggestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "(运营端) 精度校正")
@RestController
@RequestMapping("/admin/prod/suggest")
public class TProdSuggestController {
    @Autowired
    private ITProdSuggestService prodSuggestService;

    @GetMapping("/list")
    @ApiOperation(value = "精度校正列表查询",response = TProdRecordSuggestVO.class)
    public ResultEntity listByPage(TProdSuggestDTO params){
        PageUtil.startPage(params);
        return ResultEntity.createSuccess(PageUtil.getPageList(prodSuggestService.getProdAndSuggest(params)));
    }

    @PostMapping("/add")
    @ApiOperation(value = "增加校正")
    public ResultEntity add(@RequestBody TProdSuggestDTO.TProdSuggestAddDTO params) {
        prodSuggestService.add(params);
        return ResultEntity.createSuccess();
    }

}
